<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@ page language="java" import="java.sql.*"%>
<%@ page language="java" import="java.io.*"%>
<%@ page language="java" import="javax.sql.*"%>
<%@ page language="java" import="javax.sql.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
response.setContentType("text/html;charset=utf-8");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'show.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="js/test_new.js"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>  
    <%  
        request.setCharacterEncoding("utf-8");  
        String name = request.getParameter("name");  
        Connection con;
        Statement sm;
        ResultSet rs;
        ResultSet num;
        PreparedStatement ps;
        ResultSet secret;
        int flag;
        String data = null;
		 
		Class.forName("com.mysql.jdbc.Driver");
        con = DriverManager.getConnection("jdbc:mysql://localhost:3306/"+"rual","root","rual");
    	sm =con.createStatement();
		
		
     
		ps=con.prepareStatement("select content from user where name = '"+name+"' ");
		rs = ps.executeQuery();
		if(rs.next()){
		data = rs.getString("content");
		}
		out.println("<div align='center'>");
		out.println("<hr/>");
		out.println(data);
		out.println("<hr/>");
		
		out.println("<input type='button' value='返回' onclick='split()'/>");
		out.println("<hr/>");
		out.println("</div>");
		
		
		
    %>  
    
</body>  
</html>
